
Introduction
Environment Setup
What is JavaScript vs ES-5 or ES-6
JavaScript Syntax
JavaScript Comments
JavaScript Use Strict
JavaScript Variables
JavaScript Reserved Words
JavaScript Scope
JavaScript Data Types
JavaScript Function
Function overloading not possible in JavaScript
JavaScript Arrow Function
JavaScript Numbers
JavaScript Number Methods
JavaScript String
JavaScript String Methods
JavaScript if else and else if
JavaScript Comparison and Logical Operators
JavaScript Arrays
JavaScript Sorting Arrays
JavaScript Array Iteration Methods
JavaScript for loop
JavaScript Let keyword
JavaScript Const
JavaScript Objects
JavaScript Object Methods
JavaScript ES5 Object Methods
JavaScript Object Accessors
JavaScript Math Object
JavaScript Random
JavaScript this Keyword
JavaScript Date Objects and Date Formats
JavaScript Classes
JavaScript While Loop
JavaScript Break and Continue
JavaScript Switch Statement
JavaScript JSON
Error handling in JavaScript
JavaScript has for loop. When we want work with collection or array then some time use the for loop. But looping mechanism means when we work repeat by the condition then we use loop in JavaScript. JavaScript loop is very important. Basically, for loop have three part one is Initializing another is conditional and last part is increment or decrement. Now given bellow the example code and explain the code:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
// JavaScript for loop
var myName="Farhan Sakib Jesy";
for (var i = 1; i <= 5; i++) {
console.log(myName);
}
var name = ["Jesy", "Reza", "Tofile"];
for (var i = 0; name.length; i++) {
console.log(name[i]);
}
</script>
</body>
</html>
In this part we print the name and then we print the array using for-loop. This loop will use also another purpose also your need.